<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>${fns:getConfig('productName')}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="${ctx}/js/echarts.js"></script>
<script src="${ctx}/scripts/tj/echart_init.js"></script>
<script>
 var year;
	$(function(){
		countJson();
	})
	
	function countJson(){
		var url = "${ctx}/specialProject/countJson.do";
		$.ajax({
			type:'POST',
			url:url,
			async:false,
			dataType:'json',
			success:function(data){
				$('#project table').remove();
				echartsData =  ECharts.ChartDataFormate.GetYAndGroupData(data); //解析数据 便于echarts显示
				category = echartsData.category;
				xAxis = echartsData.xAxis;
				dataJson = echartsData.result;
				var myechart = echarts.init(document.getElementById('zx-urban'));
				var option;
				myechart.clear(); 
				option = ECharts.ChartOptionTemplates.Lines(data,"专项工程 汇总表",'数值');  
				myechart.setOption(option);
				if(category.length !=0){
					dataTableView(category,xAxis,dataJson,'project','年份');
					$("#downFile").attr('href','${ctx}/specialProject/export.do');
				} else {
					$('#downFile').css('display','none');
				}
				
			}
		})
	}
	

function down(){
	var url = "${ctx}/lifeProject/export.do?year="+year;
	console.log(url);
	$.ajax({
		type:'POST',
		url:url,
		async:false,
		dataType:'json',
		success:function(data){
			
		}
	})
}
</script>
</head>
<body>
    	<div  style="padding-bottom:10px;width:80%;margin:auto" id="project" >
    	<div id="zx-urban" style="height: 350px;width:100%;float:left;"></div>
    	<div style="float:left;margin:5px;">
    		<a href ="" id="downFile" class="btn btn-primary" role="button">下载</a>
    	</div>
    	
    	</div>
    	
</body>
</html>